<?php

# Error controls
error_reporting (E_ALL);

# Define constants
define('OI', true);
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
define('ROOT_PATH', dirname(dirname(dirname(dirname(__FILE__))))."/");
define('SOURCE_PATH', ROOT_PATH."/sources/");

# Valid request?
if((empty($_POST) && empty($_GET)) || !IS_AJAX) {
		
	print '<h1>Security Error</h1>Sorry, this action is forbidden.';
	exit();
		
}

# Load configuration
include(SOURCE_PATH.'Config.php');
define('PREFIX', $config['prefix']);

# Load our CMS class
include_once(SOURCE_PATH.'class/SiteBuilder.php');

# Initialise the class
$siteBuilder = new SiteBuilder($config);
$siteBuilder->initialise();

?>